﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace TFSTools.TFSLibrary.VersionControl
{
    public sealed class TFSItemSecurity : TFSServerEntity
    {
        private ItemSecurity serverItemSecurity;

        internal TFSItemSecurity(ITFSConnection connection, ItemSecurity itemSecurity)
            : base(connection)
        {
            this.serverItemSecurity = itemSecurity;
        }
    }

    public sealed class TFSItemSecurityCollection : TFSServerEntityCollection<TFSItemSecurity>
    {
        public TFSItemSecurityCollection(ITFSConnection connection)
            : base(connection)
        {
        }

        public TFSItemSecurityCollection(ITFSConnection connection, IList<TFSItemSecurity> list)
            : base(connection, list)
        {
        }

        public TFSItemSecurityCollection(ITFSConnection connection, int capacity)
            : base(connection, capacity)
        {
        }

        internal static TFSItemSecurityCollection Create(ITFSConnection connection, ItemSecurity[] sets)
        {
            var list = new List<TFSItemSecurity>(sets.Length);

            foreach (var set in sets)
            {
                list.Add(new TFSItemSecurity(connection, set));
            }

            return new TFSItemSecurityCollection(connection, list);
        }
    }
}
